/*! \file loggerc.h
    \brief Main Logger Library file.
*/
#ifndef _LOGGERC_H_
#define _LOGGERC_H_
/** @defgroup main Main

    Main Logger section.
	@{
*/

/** @defgroup main_general General

	Contains general routines to initialize and terminate the library.
	@{
*/

/** Logger version */
#define LOGGER_VERSION "1.0.0"

#include <stdio.h>
#include <string.h>
#include <malloc.h>
#ifdef PSP
    #include <pspkernel.h>
    #include <pspdisplay.h>
    #include <pspdebug.h>
    #include <pspsdk.h>
    #include <psprtc.h>
#endif


#ifdef __cplusplus
extern "C" {
#endif

    /** Flags for level logger. */
    enum LOG_LEVEL	{
        INF=0,						//!< Level INF for INFO logger.
        DBG=1,                      //!< Level DBG for DEBUG logger.
        WRN=2,						//!< Level WRN for WARNING logger.
        ERR=3,						//!< Level ERR for ERROR logger.
    };
    /** Define for active DEBUG. */
    enum FLAG_DEBUG {
        NODEBUG = 0,                //!< Flag value to deactive DEBUG
        DEBUG = 1,                  //!< Flag value to active DEBUG
    };

    /** Initializes the logger.

        \param path
                It's filename with path
        \param lenStrRecord
                lenght of row write to file.
        \param  trace
                use with FLAG_DEBUG value
        \return fd
                address of file created
    */
    extern int initLog(char *path, int lenStrRecord, int trace);

    /** Close the logger.

        \param fd
            file address of Logger active
    */
    extern void deinitLog(int fd);

    /** Write record with logger.

        \param log_file
            file address of Logger active
        \param log_level
            level of LOG. Use LOG_LEVEL enum
        \param p_desc
            description for logger
    */
    extern void writelog ( int log_file, int log_level,	char *p_desc);

    /** @} */ // end of main_general

    /** @defgroup main_debug DEBUG

        Contains function to enabel/disable DEBUG Logging.
        @{
    */
    /** Enable DEBUG logger.*/
    extern void setDebugON();
    /** Disable DEBUG logger.*/
    extern void setDebugOFF();
    /** @} */ // end of debug

    /** @} */ // end of main

#ifdef __cplusplus
}
#endif

#endif
